/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entidades;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 *
 * @author Oswl_C
 */
@Entity
@Table(name = "alumno", catalog = "lecturadb", schema = "")
@NamedQueries({
    @NamedQuery(name = "Alumno.findAll", query = "SELECT a FROM Alumno a"),
    @NamedQuery(name = "Alumno.findByAluCedula", query = "SELECT a FROM Alumno a WHERE a.aluCedula = :aluCedula"),
    @NamedQuery(name = "Alumno.findByAluApellidos", query = "SELECT a FROM Alumno a WHERE a.aluApellidos = :aluApellidos"),
    @NamedQuery(name = "Alumno.findByAluNombres", query = "SELECT a FROM Alumno a WHERE a.aluNombres = :aluNombres"),
    @NamedQuery(name = "Alumno.findByAluTelefono", query = "SELECT a FROM Alumno a WHERE a.aluTelefono = :aluTelefono"),
    @NamedQuery(name = "Alumno.findByAluDireccion", query = "SELECT a FROM Alumno a WHERE a.aluDireccion = :aluDireccion")})
public class Alumno implements Serializable {
    @Transient
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ALU_CEDULA")
    private String aluCedula;
    @Column(name = "ALU_APELLIDOS")
    private String aluApellidos;
    @Column(name = "ALU_NOMBRES")
    private String aluNombres;
    @Column(name = "ALU_TELEFONO")
    private String aluTelefono;
    @Column(name = "ALU_DIRECCION")
    private String aluDireccion;

    public Alumno() {
    }

    public Alumno(String aluCedula) {
        this.aluCedula = aluCedula;
    }

    public String getAluCedula() {
        return aluCedula;
    }

    public void setAluCedula(String aluCedula) {
        String oldAluCedula = this.aluCedula;
        this.aluCedula = aluCedula;
        changeSupport.firePropertyChange("aluCedula", oldAluCedula, aluCedula);
    }

    public String getAluApellidos() {
        return aluApellidos;
    }

    public void setAluApellidos(String aluApellidos) {
        String oldAluApellidos = this.aluApellidos;
        this.aluApellidos = aluApellidos;
        changeSupport.firePropertyChange("aluApellidos", oldAluApellidos, aluApellidos);
    }

    public String getAluNombres() {
        return aluNombres;
    }

    public void setAluNombres(String aluNombres) {
        String oldAluNombres = this.aluNombres;
        this.aluNombres = aluNombres;
        changeSupport.firePropertyChange("aluNombres", oldAluNombres, aluNombres);
    }

    public String getAluTelefono() {
        return aluTelefono;
    }

    public void setAluTelefono(String aluTelefono) {
        String oldAluTelefono = this.aluTelefono;
        this.aluTelefono = aluTelefono;
        changeSupport.firePropertyChange("aluTelefono", oldAluTelefono, aluTelefono);
    }

    public String getAluDireccion() {
        return aluDireccion;
    }

    public void setAluDireccion(String aluDireccion) {
        String oldAluDireccion = this.aluDireccion;
        this.aluDireccion = aluDireccion;
        changeSupport.firePropertyChange("aluDireccion", oldAluDireccion, aluDireccion);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (aluCedula != null ? aluCedula.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Alumno)) {
            return false;
        }
        Alumno other = (Alumno) object;
        if ((this.aluCedula == null && other.aluCedula != null) || (this.aluCedula != null && !this.aluCedula.equals(other.aluCedula))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "lecturarapida.Alumno[ aluCedula=" + aluCedula + " ]";
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }
    
}
